package com.thinkgem.jeesite.modules.qx.task;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import com.thinkgem.jeesite.modules.qx.entity.QxMatch;
import com.thinkgem.jeesite.modules.qx.entity.QxTeam;
import com.thinkgem.jeesite.modules.qx.entity.QxTeamMatch;
import com.thinkgem.jeesite.modules.qx.service.QxMatchService;
import com.thinkgem.jeesite.modules.qx.service.QxTeamMatchService;
import com.thinkgem.jeesite.modules.qx.service.QxTeamService;

@Service
@Lazy(false)
public class TestTask {
    private static int NUMBER = 1;
    
    @Autowired
    private QxTeamService qxTeamService;
    
    @Autowired
    private QxMatchService qxMatchService;

    @Autowired
    private QxTeamMatchService qxTeamMatchService;
    
//    @Scheduled(cron="0/15 * * * * ? ")
    @Scheduled(cron="0 0 15 * * ? ")
    public void exec(){
    	List<QxTeam> qxTeams = qxTeamService.findList(new QxTeam());
    	for (QxTeam qxTeam : qxTeams) {
    		QxTeamMatch qxTeamMatch = new QxTeamMatch();
    		qxTeamMatch.setTeamid(qxTeam.getId());
			List<QxTeamMatch> qxTeamMatchs = qxTeamMatchService.findList(qxTeamMatch);
			if (qxTeamMatchs != null && qxTeamMatchs.size() > 0) {
				
			}
		}
    }    
}
